package dj.common.exception;

import lombok.Getter;
import lombok.Setter;

/**
 * <br>
 * <p>运行时Exception基类</p>
 *
 * <br>
 * @author ZJG
 * @version 1.0
 * @date 2021/7/7 下午2:19
 */
@Setter
@Getter
public class BaseRunTimeException extends RuntimeException {

    protected String domainCode = null;

    protected String message = null;

    protected int code = 500;


    public BaseRunTimeException(Throwable throwable) {
        super(throwable);
    }

    public BaseRunTimeException(String message) {
        super(message);
        this.message = message;
    }

    public BaseRunTimeException(String message, Throwable throwable) {
        super(message, throwable);
        this.message = message;
    }

    public BaseRunTimeException(int code, String message) {
        super("error_code='" + code + "', error_msg='" + message + "'");
        this.code = code;
        this.message = message;
    }

    public BaseRunTimeException(String domainCode, int code, String message) {
        super(domainCode + ", error_code='" + code + "', error_msg='" + message + "'");
        this.domainCode = domainCode;
        this.code = code;
        this.message = message;
    }

}
